<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
    <head>
        <meta charset="UTF-8">
        <title>Title</title>
    </head>
    <body>
        <!--用fragment1替换，包括内容和样式；-->
        <div th:replace="header::fragment1"></div>
        <div style="width: 100%; height: 500px">定义内容</div>

        <!--只引用fragment2的内容不引用样式-->
        <div th:include="footer::fragment2"></div>

    </body>
</html>